<template>
	<view class="star-wapper">
		<image 
		src="../static/icos/star-yellow.png" mode="" 
		class="star-icon"
		v-for="item in yellow"
		></image>
		<image
		src="../static/icos/star-gray.png" mode="" 
		class="star-icon"
		v-for="item in gray"
		></image>
		<text class="star-word" v-if="showNumber==1">{{score}}</text>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				all:5//总星星
			};
		},
		props:["score","showNumber"],
		computed:{
			yellow(){
				return Math.floor(this.score/2) 
			},
			gray(){
				return 5-this.yellow
			}
		}
	}
</script>

<style scoped>
.star-wapper{
	display: flex;
}
.star-icon{
	width: 15px;
	height: 15px;
}
.star-word{
	font-size: 15px;
	color: #bebebe;
	margin-left: 10upx;
}
</style>
